import request from '@/config/axios'

// 线下店 VO
export interface StoreManagerVO {
  id: number // 编号
  name: string // 名字
  address: string // 店铺地址
  longitude: string // 店铺地址经度
  latitude: string // 店铺地址纬度
  location: Object
  banner: number // BannerID
  pop: number // 弹窗ID
  status: number // 状态
}

// 线下店 API
export const StoreManagerApi = {
  // 查询线下店分页
  getStoreManagerPage: async (params: any) => {
    return await request.get({ url: `/mall/store-manager/page`, params })
  },

  // 查询线下店详情
  getStoreManager: async (id: number) => {
    return await request.get({ url: `/mall/store-manager/get?id=` + id })
  },

  // 新增线下店
  createStoreManager: async (data: StoreManagerVO) => {
    return await request.post({ url: `/mall/store-manager/create`, data })
  },

  // 修改线下店
  updateStoreManager: async (data: StoreManagerVO) => {
    return await request.put({ url: `/mall/store-manager/update`, data })
  },

  // 删除线下店
  deleteStoreManager: async (id: number) => {
    return await request.delete({ url: `/mall/store-manager/delete?id=` + id })
  },

  // 导出线下店 Excel
  exportStoreManager: async (params) => {
    return await request.download({ url: `/mall/store-manager/export-excel`, params })
  },
}
